{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from scipy.stats import beta\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "plt.rcParams['figure.figsize']=(15,5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0.5,0,'(b)')"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA3AAAAFACAYAAAD9D55TAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAHzpJREFUeJzt3W2QpWdZJ/D/ZYaAykuANDE7ExwsRhfKKiBOYSy2XCDqQmKRfCArFELE7E6VIoWLtTK6H1x3ra1ht9YoVRYaDetAIZCNYKZIFo0hLMuWCQxv4SVSGeNIphKZEZKoxaIGr/3QT8fO9EnmTE+fc/rp/v2qus7z3M/d3VffM9P3/M/9vFR3BwAAgM3vWxZdAAAAANMR4AAAAEZCgAMAABgJAQ4AAGAkBDgAAICREOAAAABGQoADAAAYCQEOAABgJAQ4AACAkdix6AKS5Nxzz+3du3cvugwA5uCTn/zkX3X30qLrGAtzJMD2MO38uCkC3O7du3P48OFFlwHAHFTVXyy6hjExRwJsD9POj06hBAAAGAkBDgAAYCQEOAAAgJEQ4AAAAEZCgAMAABgJAQ4AAGAkBDgAAICREOAAAABGQoADAAAYCQEOAABgJAQ4AACAkdix6AI2yu79Nz68ffTApQusBADYaCvzvDke2O6swAEAAIyEAAcAADASW+YUSgBg63BpBMBkAhwAMCrCHbCdOYUSAABgJAQ4AACAkRDgAAAARkKAAwAAGAkBDgAAYCQEOAAAgJEQ4AAAAEZiqgBXVUer6n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lJN/X3f9QVUdXHUuSxyf5xnzLA4CFWT1HJsnJp4at3n/C0B+2NStwMGPdfX+Ss6rqCUmekuT4EN5ekuQ7V/pV1dOTnOjuf1hQqQAwVyfNkUnywqp61nDt248l+ViSVFUl+Y4kRxdSKGwiAhzMxx9l+TSQdyfZW1WHs7wa96er+rwkyU0LqA0AFmlljkySP0lyIMnnk/x5kg8M7d+X5Lbufmj+5cHm4iYmMAdV9YIkb+7u1z5Gn/cn+YXu/tL8KgOAxZpyjvz1JIe6+5b5VQabkxU4mIPu/nSSWx/rQd5J/kB4A2C7OdUcOfi88AbLrMABAACMhBU4AACAkRDgAAAARkKAAwAAGAkBDgAAYCQEOAAAgJH4/8VLdDwAJl8FAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 1080x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 从beta(1,5)中采集样本\n",
    "x1=beta.rvs(a=1,b=5,size=10000)\n",
    "bins=np.linspace(0,1,100)\n",
    "ax1 = plt.subplot(121)\n",
    "result=ax1.hist(x1,bins,align='left',rwidth=0.7)\n",
    "ax1.set_xlabel('(a)')\n",
    "\n",
    "N=5   # 采集5次\n",
    "xx = np.empty((N,10000))\n",
    "for i in range(N):\n",
    "    xx[i,:]=beta.rvs(a=1,b=5,size=10000)\n",
    "x2 = np.sum(xx,axis=0)/N\n",
    "ax2 = plt.subplot(122)\n",
    "result2=ax2.hist(x2,bins,align='left',rwidth=0.7)\n",
    "ax2.set_xlabel('(b)')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
